<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!--      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户昵称" prop="nickName">
        <el-input
          v-model="queryParams.nickName"
          placeholder="请输入用户昵称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="department">
        <el-select v-model="queryParams.department" placeholder="请选择部门" clearable>
          <el-option
            v-for="dict in dict.type.yqg_department"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="用户账号" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入用户账号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职务" prop="post">
        <el-select v-model="queryParams.post" placeholder="请选择职务" clearable>
          <el-option
            v-for="dict in dict.type.yqg_post"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>-->
<!--      <el-form-item label="手牌号" prop="handBrand">
        <el-input
          v-model="queryParams.handBrand"
          placeholder="请输入手牌号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="原手牌" prop="originalHand">
        <el-input
          v-model="queryParams.originalHand"
          placeholder="请输入原手牌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="手牌类别" prop="handCategory">
        <el-select v-model="queryParams.handCategory" placeholder="请选择手牌类别" clearable>
          <el-option
            v-for="dict in dict.type.yqg_hand_category"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="留牌状态" prop="retentionStatus">
        <el-select v-model="queryParams.retentionStatus" placeholder="请选择留牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_retention_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="并牌状态" prop="mergeStatus">
        <el-select v-model="queryParams.mergeStatus" placeholder="请选择并牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_merge_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="手牌状态" prop="handState">
        <el-select v-model="queryParams.handState" placeholder="请选择手牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_hand_state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>-->
<!--      <el-form-item label="人数" prop="numberOfPeople">
        <el-input
          v-model="queryParams.numberOfPeople"
          placeholder="请输入人数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总费用" prop="allCost">
        <el-input
          v-model="queryParams.allCost"
          placeholder="请输入总费用"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开牌时间" prop="openingTime">
        <el-input
          v-model="queryParams.openingTime"
          placeholder="请输入开牌时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="团体号" prop="groupId">
        <el-input
          v-model="queryParams.groupId"
          placeholder="请输入团体号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单号" prop="oddNumbers">
        <el-input
          v-model="queryParams.oddNumbers"
          placeholder="请输入单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="儿童" prop="children">
        <el-input
          v-model="queryParams.children"
          placeholder="请输入儿童"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主牌" prop="mastercard">
        <el-input
          v-model="queryParams.mastercard"
          placeholder="请输入主牌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="交班时间" prop="handoverTime">
        <el-date-picker clearable
          v-model="queryParams.handoverTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择交班时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="吧台号" prop="barNumber">
        <el-input
          v-model="queryParams.barNumber"
          placeholder="请输入吧台号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="班次" prop="sailings">
        <el-input
          v-model="queryParams.sailings"
          placeholder="请输入班次"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="同来" prop="together">
        <el-input
          v-model="queryParams.together"
          placeholder="请输入同来"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="备注" prop="note">
        <el-input
          v-model="queryParams.note"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="团体备注" prop="groupNotes">
        <el-input
          v-model="queryParams.groupNotes"
          placeholder="请输入团体备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="折扣额" prop="discountAmount">
        <el-input
          v-model="queryParams.discountAmount"
          placeholder="请输入折扣额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="结账时间" prop="checkoutTime">
        <el-date-picker clearable
          v-model="queryParams.checkoutTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择结账时间">
        </el-date-picker>
      </el-form-item>
<!--      <el-form-item label="补齐消费" prop="supplementaryConsumption">
        <el-input
          v-model="queryParams.supplementaryConsumption"
          placeholder="请输入补齐消费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实收额" prop="paidInAmount">
        <el-input
          v-model="queryParams.paidInAmount"
          placeholder="请输入实收额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="实收现金" prop="paidInCash">
        <el-input
          v-model="queryParams.paidInCash"
          placeholder="请输入实收现金"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="找零金额" prop="changeAmount">
        <el-input
          v-model="queryParams.changeAmount"
          placeholder="请输入找零金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="付款方式" prop="paymentMethod">
        <el-select v-model="queryParams.paymentMethod" placeholder="请选择付款方式">
          <el-option
            v-for="dict in dict.type.yqg_payment_method"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          ></el-option>
        </el-select>
<!--        <el-input
          v-model="queryParams.paymentMethod"
          placeholder="请输入付款方式"
          clearable
          @keyup.enter.native="handleQuery"
        />-->
      </el-form-item>
<!--      <el-form-item label="总消费金额" prop="totalConsumptionAmount">
        <el-input
          v-model="queryParams.totalConsumptionAmount"
          placeholder="请输入总消费金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开牌人" prop="cardiner">
        <el-input
          v-model="queryParams.cardiner"
          placeholder="请输入开牌人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="结账人" prop="checkout">
        <el-input
          v-model="queryParams.checkout"
          placeholder="请输入结账人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="前台标志" prop="frontSign">
        <el-input
          v-model="queryParams.frontSign"
          placeholder="请输入前台标志"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="前台打印时间" prop="frontPrintTime">
        <el-date-picker clearable
          v-model="queryParams.frontPrintTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择前台打印时间">
        </el-date-picker>
      </el-form-item>-->
      <el-form-item label="操作员" prop="operator">
        <el-input
          v-model="queryParams.operator"
          placeholder="请输入操作员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="结账位置" prop="checkoutLocation">
        <el-input
          v-model="queryParams.checkoutLocation"
          placeholder="请输入结账位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
<!--      <el-form-item label="备注1" prop="note1">
        <el-input
          v-model="queryParams.note1"
          placeholder="请输入备注1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注2" prop="note2">
        <el-input
          v-model="queryParams.note2"
          placeholder="请输入备注2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注3" prop="note3">
        <el-input
          v-model="queryParams.note3"
          placeholder="请输入备注3"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注4" prop="note4">
        <el-input
          v-model="queryParams.note4"
          placeholder="请输入备注4"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注5" prop="note5">
        <el-input
          v-model="queryParams.note5"
          placeholder="请输入备注5"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注6" prop="note6">
        <el-input
          v-model="queryParams.note6"
          placeholder="请输入备注6"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注7" prop="note7">
        <el-input
          v-model="queryParams.note7"
          placeholder="请输入备注7"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注8" prop="note8">
        <el-input
          v-model="queryParams.note8"
          placeholder="请输入备注8"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注9" prop="note9">
        <el-input
          v-model="queryParams.note9"
          placeholder="请输入备注9"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注10" prop="note10">
        <el-input
          v-model="queryParams.note10"
          placeholder="请输入备注10"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item>
        <el-button style="height:35px;width: 70px ;font-size: 14px" type="primary"   @click="handleQuery">搜 索</el-button>
        <el-button style="height:35px;width: 70px ;font-size: 14px"  @click="resetQuery">重 置</el-button>
        <el-button style="height:35px;width: 70px ;font-size: 14px;margin-left: 360px" type="primary" plain  @click="back">返 回</el-button>

      </el-form-item>
    </el-form>
    <br>
    <el-row :gutter="10" class="mb8">
   <!--   <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['project:bills:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['project:bills:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['project:bills:remove']"
        >删除</el-button>
      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['project:bills:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table border v-loading="loading" :data="billsList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="ID" align="center" prop="ID" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="用户昵称" align="center" prop="nickName" />
      <el-table-column label="部门" align="center" prop="department">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_department" :value="scope.row.department"/>
        </template>
      </el-table-column>
      <el-table-column label="用户账号" align="center" prop="userName" />
      <el-table-column label="职务" align="center" prop="post">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_post" :value="scope.row.post"/>
        </template>
      </el-table-column>-->
      <el-table-column label="手牌号" align="center" prop="handBrand" />
<!--      <el-table-column label="原手牌" align="center" prop="originalHand" />
      <el-table-column label="手牌类别" align="center" prop="handCategory">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_hand_category" :value="scope.row.handCategory"/>
        </template>
      </el-table-column>-->
      <el-table-column label="留牌状态" align="center" prop="retentionStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_retention_status" :value="scope.row.retentionStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="并牌状态" align="center" prop="mergeStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_merge_status" :value="scope.row.mergeStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="手牌状态" align="center" prop="handState">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_hand_state" :value="scope.row.handState"/>
        </template>
      </el-table-column>
<!--      <el-table-column label="人数" align="center" prop="numberOfPeople" />-->
      <el-table-column label="总费用" align="center" prop="allCost" />
<!--      <el-table-column label="开牌时间" align="center" prop="openingTime" />-->
      <el-table-column label="团体号" align="center" prop="groupId" />
      <el-table-column label="单号" align="center" prop="oddNumbers" />
<!--      <el-table-column label="儿童" align="center" prop="children" />
      <el-table-column label="主牌" align="center" prop="mastercard" />
      <el-table-column label="交班时间" align="center" prop="handoverTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.handoverTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交班状态" align="center" prop="handoverStatus" />
      <el-table-column label="吧台号" align="center" prop="barNumber" />
      <el-table-column label="班次" align="center" prop="sailings" />
      <el-table-column label="同来" align="center" prop="together" />-->
      <el-table-column label="备注" align="center" prop="note" />
      <el-table-column label="团体备注" align="center" prop="groupNotes" />
<!--      <el-table-column label="折扣额" align="center" prop="discountAmount" />-->
      <el-table-column label="结账时间" align="center" prop="checkoutTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkoutTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
<!--      <el-table-column label="补齐消费" align="center" prop="supplementaryConsumption" />
      <el-table-column label="实收额" align="center" prop="paidInAmount" />
      <el-table-column label="实收现金" align="center" prop="paidInCash" />
      <el-table-column label="找零金额" align="center" prop="changeAmount" />
      <el-table-column label="付款方式" align="center" prop="paymentMethod" />
      <el-table-column label="总消费金额" align="center" prop="totalConsumptionAmount" />
      <el-table-column label="开牌人" align="center" prop="cardiner" />
      <el-table-column label="结账人" align="center" prop="checkout" />
      <el-table-column label="前台标志" align="center" prop="frontSign" />
      <el-table-column label="前台打印时间" align="center" prop="frontPrintTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.frontPrintTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>-->
      <el-table-column label="操作员" align="center" prop="operator" />
<!--      <el-table-column label="结账位置" align="center" prop="checkoutLocation" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
<!--          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['project:bills:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete"
            v-hasPermi="['project:bills:remove']"
          >删除</el-button>-->
          <el-button
            size="mini"
            type="text"
            @click="detail(scope.row)"
            v-hasPermi="['project:bills:edit']"
          >详细</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改吧台账单对话框 -->
<!--    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="用户昵称" prop="nickName">
          <el-input v-model="form.nickName" placeholder="请输入用户昵称" />
        </el-form-item>
        <el-form-item label="部门" prop="department">
          <el-select v-model="form.department" placeholder="请选择部门">
            <el-option
              v-for="dict in dict.type.yqg_department"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用户账号" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入用户账号" />
        </el-form-item>
        <el-form-item label="职务" prop="post">
          <el-select v-model="form.post" placeholder="请选择职务">
            <el-option
              v-for="dict in dict.type.yqg_post"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="手牌号" prop="handBrand">
          <el-input v-model="form.handBrand" placeholder="请输入手牌号" />
        </el-form-item>
        <el-form-item label="原手牌" prop="originalHand">
          <el-input v-model="form.originalHand" placeholder="请输入原手牌" />
        </el-form-item>
        <el-form-item label="手牌类别" prop="handCategory">
          <el-select v-model="form.handCategory" placeholder="请选择手牌类别">
            <el-option
              v-for="dict in dict.type.yqg_hand_category"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="留牌状态" prop="retentionStatus">
          <el-select v-model="form.retentionStatus" placeholder="请选择留牌状态">
            <el-option
              v-for="dict in dict.type.yqg_retention_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="并牌状态" prop="mergeStatus">
          <el-select v-model="form.mergeStatus" placeholder="请选择并牌状态">
            <el-option
              v-for="dict in dict.type.yqg_merge_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="手牌状态" prop="handState">
          <el-select v-model="form.handState" placeholder="请选择手牌状态">
            <el-option
              v-for="dict in dict.type.yqg_hand_state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="人数" prop="numberOfPeople">
          <el-input v-model="form.numberOfPeople" placeholder="请输入人数" />
        </el-form-item>
        <el-form-item label="总费用" prop="allCost">
          <el-input v-model="form.allCost" placeholder="请输入总费用" />
        </el-form-item>
        <el-form-item label="开牌时间" prop="openingTime">
          <el-input v-model="form.openingTime" placeholder="请输入开牌时间" />
        </el-form-item>
        <el-form-item label="团体号" prop="groupId">
          <el-input v-model="form.groupId" placeholder="请输入团体号" />
        </el-form-item>
        <el-form-item label="单号" prop="oddNumbers">
          <el-input v-model="form.oddNumbers" placeholder="请输入单号" />
        </el-form-item>
        <el-form-item label="儿童" prop="children">
          <el-input v-model="form.children" placeholder="请输入儿童" />
        </el-form-item>
        <el-form-item label="主牌" prop="mastercard">
          <el-input v-model="form.mastercard" placeholder="请输入主牌" />
        </el-form-item>
        <el-form-item label="交班时间" prop="handoverTime">
          <el-date-picker clearable
            v-model="form.handoverTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择交班时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="吧台号" prop="barNumber">
          <el-input v-model="form.barNumber" placeholder="请输入吧台号" />
        </el-form-item>
        <el-form-item label="班次" prop="sailings">
          <el-input v-model="form.sailings" placeholder="请输入班次" />
        </el-form-item>
        <el-form-item label="同来" prop="together">
          <el-input v-model="form.together" placeholder="请输入同来" />
        </el-form-item>
        <el-form-item label="备注" prop="note">
          <el-input v-model="form.note" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="团体备注" prop="groupNotes">
          <el-input v-model="form.groupNotes" placeholder="请输入团体备注" />
        </el-form-item>
        <el-form-item label="折扣额" prop="discountAmount">
          <el-input v-model="form.discountAmount" placeholder="请输入折扣额" />
        </el-form-item>
        <el-form-item label="结账时间" prop="checkoutTime">
          <el-date-picker clearable
            v-model="form.checkoutTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择结账时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="补齐消费" prop="supplementaryConsumption">
          <el-input v-model="form.supplementaryConsumption" placeholder="请输入补齐消费" />
        </el-form-item>
        <el-form-item label="实收额" prop="paidInAmount">
          <el-input v-model="form.paidInAmount" placeholder="请输入实收额" />
        </el-form-item>
        <el-form-item label="实收现金" prop="paidInCash">
          <el-input v-model="form.paidInCash" placeholder="请输入实收现金" />
        </el-form-item>
        <el-form-item label="找零金额" prop="changeAmount">
          <el-input v-model="form.changeAmount" placeholder="请输入找零金额" />
        </el-form-item>
        <el-form-item label="付款方式" prop="paymentMethod">
          <el-input v-model="form.paymentMethod" placeholder="请输入付款方式" />
        </el-form-item>
        <el-form-item label="总消费金额" prop="totalConsumptionAmount">
          <el-input v-model="form.totalConsumptionAmount" placeholder="请输入总消费金额" />
        </el-form-item>
        <el-form-item label="开牌人" prop="cardiner">
          <el-input v-model="form.cardiner" placeholder="请输入开牌人" />
        </el-form-item>
        <el-form-item label="结账人" prop="checkout">
          <el-input v-model="form.checkout" placeholder="请输入结账人" />
        </el-form-item>
        <el-form-item label="前台标志" prop="frontSign">
          <el-input v-model="form.frontSign" placeholder="请输入前台标志" />
        </el-form-item>
        <el-form-item label="前台打印时间" prop="frontPrintTime">
          <el-date-picker clearable
            v-model="form.frontPrintTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择前台打印时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="操作员" prop="operator">
          <el-input v-model="form.operator" placeholder="请输入操作员" />
        </el-form-item>
        <el-form-item label="结账位置" prop="checkoutLocation">
          <el-input v-model="form.checkoutLocation" placeholder="请输入结账位置" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" placeholder="请输入备注1" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" placeholder="请输入备注2" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" placeholder="请输入备注3" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" placeholder="请输入备注4" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" placeholder="请输入备注5" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" placeholder="请输入备注6" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" placeholder="请输入备注7" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" placeholder="请输入备注8" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" placeholder="请输入备注9" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" placeholder="请输入备注10" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>-->
  </div>
</template>

<script>
import { getBills, delBills, addBills, updateBills,ppp } from "@/api/project/bills";
import {listBills } from "@/api/module/whd/duizhang"

export default {
  name: "Bills",
  dicts: ['yqg_hand_category', 'yqg_hand_state', 'yqg_payment_method', 'yqg_consumption_status', 'yqg_retention_status', 'yqg_project_category', 'yqg_post', 'yqg_check_out_status', 'yqg_department', 'yqg_merge_status', 'yqg_sailings_signs', 'yqg_next_clock_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 吧台账单表格数据
      billsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        deptId: null,
        nickName: null,
        department: null,
        userName: null,
        post: null,
        handBrand: null,
        originalHand: null,
        handCategory: null,
        retentionStatus: null,
        mergeStatus: null,
        handState:"0",
        numberOfPeople: null,
        allCost: null,
        openingTime: null,
        groupId: null,
        oddNumbers: null,
        children: null,
        mastercard: null,
        handoverTime: null,
        handoverStatus: "0",
        barNumber: null,
        sailings: null,
        together: null,
        note: null,
        groupNotes: null,
        discountAmount: null,
        checkoutTime: null,
        supplementaryConsumption: null,
        paidInAmount: null,
        paidInCash: null,
        changeAmount: null,
        paymentMethod: null,
        totalConsumptionAmount: null,
        cardiner: null,
        checkout: null,
        frontSign: null,
        frontPrintTime: null,
        operator: null,
        checkoutLocation: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //返回方法
    back(){
      this.$router.push({path: '/batai/bartai'});
    },
    /** 查询吧台账单列表 */
    getList() {
      this.loading = true;
      console.log(this.queryParams.checkoutTime)
      listBills(this.queryParams).then(response => {
        this.billsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        ID: null,
        userId: null,
        deptId: null,
        nickName: null,
        department: null,
        userName: null,
        post: null,
        handBrand: null,
        originalHand: null,
        handCategory: null,
        retentionStatus: null,
        mergeStatus: null,
        handState: null,
        numberOfPeople: null,
        allCost: null,
        openingTime: null,
        groupId: null,
        oddNumbers: null,
        children: null,
        mastercard: null,
        handoverTime: null,
        handoverStatus: null,
        barNumber: null,
        sailings: null,
        together: null,
        note: null,
        groupNotes: null,
        discountAmount: null,
        checkoutTime: null,
        supplementaryConsumption: null,
        paidInAmount: null,
        paidInCash: null,
        changeAmount: null,
        paymentMethod: null,
        totalConsumptionAmount: null,
        cardiner: null,
        checkout: null,
        frontSign: null,
        frontPrintTime: null,
        operator: null,
        checkoutLocation: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.ID)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加吧台账单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const ID = row.id || this.ids
      console.log(ID)
      getBills(ID).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改吧台账单";
      });
    },
    detail(row){
      const ID = row.id || this.ids
      console.log(ID)
      ///batai/detail
      this.$router.push({path: '/batai/detail', query: {ID}});

    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateBills(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addBills(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete() {
      ppp(this.form).then(response => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('project/bills/export', {
        ...this.queryParams
      }, `bills_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
